package org.adultedu.dao;


import org.adultedu.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    //搜索单个用户
    User querytUser(User user);

    //获取所有用户信息
    List<User> queryAllUser();

    List queryAdmin(@Param("username")String username);

    int insertAdmin(@Param("id")String id,@Param("username")String username,@Param("password")String password,@Param("roleid")Integer roleid);

    int insertRole(@Param("id")String id,@Param("roleid")Integer roleid);

    int updateAdmin(@Param("id")String id,@Param("username")String username,@Param("password")String password,@Param("state")Integer state,@Param("reason")String reason,@Param("other")String other);

    int updateRole(@Param("id")String id,@Param("roleid")Integer roleid);

    int deleteAdmin(@Param("id")String id);
    //根据用户id获取用户名
    User queryUserById(int id);

    //根据用户名查询密码
    User queryUserByUsername(String username);

    //用户登录验证
    Map UserLogin(String username);

    //根据id修改密码
    int updateUserPwdById(int id);

    //注册一个用户
    int insertUser(User user);

    int insertUserRole(User user);

}
